package com.xfgg.cloud.adapter;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 本地缓存、分布式缓存、数据库之间保证数据一致性
 *
 * @author xfgg
 */
@RestController
@RequestMapping("cache")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CacheController {
    /**
     * 先更新数据库，再更新缓存
     */
    @GetMapping("/first")
    public void firstMethod() {

    }

    /**
     * 先删除缓存再更新数据库
     */
    @GetMapping("/second")
    public void secondMethod() {

    }

    /**
     * 延迟双删
     */
    @GetMapping("/third")
    public void thirdMethod() {

    }

    /**
     * 队列删除缓存
     */
    @GetMapping("/fourth")
    public void fourthMethod() {

    }

    /**
     * binlog订阅删除缓存
     */
    @GetMapping("/fifth")
    public void fifthMethod() {

    }
}
